package com.youaishujuhui.devops.web.util;

import java.io.IOException;

import org.nutz.json.Json;
import org.springframework.web.socket.TextMessage;
import org.springframework.web.socket.WebSocketSession;

import com.youaishujuhui.devops.web.po.WsPO;

public class WsUtil {

	public synchronized static void send(WebSocketSession wsSession, String divId, String content) throws IOException {
		WsPO po = new WsPO();
		po.setDivId(divId.replaceAll("\\.", "_"));
		po.setContent(content);
		
		wsSession.sendMessage(new TextMessage(Json.toJson(po)));
	}
	
}
